﻿@model IDictionary<string, object>

@using System.Dynamic;
@using SmartStore.Core.Themes;
@using SmartStore.Web.Framework.Themes;
@using SmartStore.Utilities;
@using SmartStore.Web.Framework.UI;

@{
    Layout = null;
    var infos = this.ThemeManifest.Variables;
    var values = this.ThemeVariables as IDictionary<string, object>;
}

@functions {
    protected override string ThemeName
    {
        get
        {
            return "Alpha";
        }
    }
}


@(Html.SmartStore().TabStrip().Name("theme-alpha-edit").HtmlAttributes(new { @class="theme-edit" }).Items(x =>
{
    var tabCommon = x.Add().Text(T("Common.General").Text).Content(@TabCommon()).Selected(true);
    var tabFonts = x.Add().Text(T("Admin.Themes.Fonts").Text).Content(@TabFonts());
    var tabGrid = x.Add().Text(T("Admin.Themes.Grid").Text).Content(@TabGrid());
    var tabButtons = x.Add().Text(T("Admin.Themes.Buttons").Text).Content(@TabButtons());
    //var tabHeader = x.Add().Text(T("Admin.Themes.Header").Text).Content(@TabHeader());
    var tabHeader = x.Add().Text("Header").Content(@TabHeader());
    var tabShopbar = x.Add().Text(T("Admin.Themes.Shopbar").Text).Content(@TabShopBar());
    var tabContentSlider = x.Add().Text(T("Admin.Themes.ContentSlider").Text).Content(@TabContentSlider());
    var tabTableAndContainer = x.Add().Text(T("Admin.Themes.Tables").Text).Content(@TabTableAndContainer());
    var tabMisc = x.Add().Text(T("Admin.Themes.Misc").Text).Content(@TabMisc());
    var tabFooter = x.Add().Text(T("Admin.Themes.Footer").Text).Content(@TabFooter());

}
))

@helper TabGrid()
{
    <table class="adminContent">
        @ThemeVarEditor("GridSettings")
        @ThemeVarEditor("GridColumnWidth")
        @ThemeVarEditor("GridGutterWidth")
        @ThemeVarEditor("GridColumnWidth1200")
        @ThemeVarEditor("GridGutterWidth1200")
    </table>
}

@helper TabButtons()
{
    <table class="adminContent">
        @ThemeVarEditor("BtnBackground", "Default")
        @ThemeVarEditor("BtnBackgroundHighlight")
        @ThemeVarEditor("BtnColor")
        @ThemeVarEditor("BtnPrimaryBackground", "Primary")
        @ThemeVarEditor("BtnPrimaryBackgroundHighlight")
        @ThemeVarEditor("BtnPrimaryColor")
        @ThemeVarEditor("BtnInfoBackground", "Info")
        @ThemeVarEditor("BtnInfoBackgroundHighlight")
        @ThemeVarEditor("BtnInfoColor")
        @ThemeVarEditor("BtnSuccessBackground", "Success")
        @ThemeVarEditor("BtnSuccessBackgroundHighlight")
        @ThemeVarEditor("BtnSuccessColor")
        @ThemeVarEditor("BtnWarningBackground", "Warning")
        @ThemeVarEditor("BtnWarningBackgroundHighlight")
        @ThemeVarEditor("BtnWarningColor")
        @ThemeVarEditor("BtnDangerBackground", "Danger")
        @ThemeVarEditor("BtnDangerBackgroundHighlight")
        @ThemeVarEditor("BtnDangerColor")
        @ThemeVarEditor("BtnInverseBackground", "Inverse")
        @ThemeVarEditor("BtnInverseBackgroundHighlight")
        @ThemeVarEditor("BtnInverseColor")
    </table>
}

@helper TabHeader()
{
    <table class="adminContent">
        @ThemeVarEditor("HeaderLinkColor")
        @ThemeVarEditor("HeaderHoverColor")
        @ThemeVarEditor("HeaderIconColor")

        @ThemeVarEditor("ChooserBorderColor", "Chooser")
        @ThemeVarEditor("ChooserBackgroundColor")
        @ThemeVarEditor("ChooserActiveStateColor")
        @ThemeVarEditor("ChooserFontColor")
    </table>
}

@helper TabFooter()
{
    <table class="adminContent">
        @ThemeVarEditor("FooterBackground")
        @ThemeVarEditor("FooterHeading")
        @ThemeVarEditor("FooterFontColor")
        @ThemeVarEditor("FooterLinkColor")
        @ThemeVarEditor("FooterRadius")
    </table>
}

@helper TabShopBar()
{
    <table class="adminContent">
        @ThemeVarEditor("ShopBarBackgroundColor", "Shopbar")
        @ThemeVarEditor("ShopBarBorderColor")
        @ThemeVarEditor("ShopBarTextColor")
        @ThemeVarEditor("ShopBarIconColor")
        @ThemeVarEditor("ShopBarLabel")

        @ThemeVarEditor("InverseNavbar", "Navbar")
        @ThemeVarEditor("NavbarHeight")
        @ThemeVarEditor("NavbarBackgroundHighlight")
        @ThemeVarEditor("NavbarText")
        @ThemeVarEditor("NavbarLinkColor")
        @ThemeVarEditor("NavbarLinkColorHover")
        @ThemeVarEditor("NavbarLinkColorActive")
        
        @ThemeVarEditor("NavbarInverseBackground")
        @ThemeVarEditor("NavbarInverseBackgroundHighlight")
        @ThemeVarEditor("NavbarInverseBorder")
        @ThemeVarEditor("NavbarInverseText")
        @ThemeVarEditor("NavbarInverseLinkColor")
        @ThemeVarEditor("NavbarInverseLinkColorHover")
        @ThemeVarEditor("NavbarInverseLinkColorActive")

    </table>
}

@helper TabCommon()
{
    <table class="adminContent">
        @ThemeVarEditor("SiteBackground")
        @ThemeVarEditor("BodyBackground")
        @ThemeVarEditor("TextColor")
        @ThemeVarEditor("LinkColor")
        @ThemeVarEditor("BoxBackground")
        
    </table>
}

@helper TabFonts()
{
    <table class="adminContent">
        @ThemeVarEditor("SansFontFamily", T("Common.General"))
        @ThemeVarEditor("SerifFontFamily")
        @ThemeVarEditor("MonoFontFamily")
        @ThemeVarEditor("BaseFontSize")
        @ThemeVarEditor("BaseLineHeight")

        @ThemeVarEditor("HeadingsFontFamily", T("ThemeVar.Alpha.Headings"))
        @ThemeVarEditor("HeadingsFontWeight")
        @ThemeVarEditor("HeadingsColor")

        @ThemeVarEditor("PageTitleFontFamily", T("ThemeVar.Alpha.PageTitle"))
        @ThemeVarEditor("PageTitleFontWeight")
        @ThemeVarEditor("PageTitleColor")

    </table>
}

@helper TabContentSlider()
{
    <table class="adminContent">
        @ThemeVarEditor("SliderUseRadialBg")
        @ThemeVarEditor("SliderBgSlide")
        @ThemeVarEditor("SliderBackgroundColor")
        @ThemeVarEditor("SliderTitleColor")
        @ThemeVarEditor("SliderTitleFontFamily")
        @ThemeVarEditor("SliderTitleFontWeight")
        @ThemeVarEditor("SliderInfoColor")
        @ThemeVarEditor("SliderInfoFontFamily")
        @ThemeVarEditor("SliderInfoFontWeight")
    </table>
}


@helper TabTableAndContainer()
{
    <table class="adminContent">

        @ThemeVarEditor("TableBackground", T("ThemeVar.Alpha.Tables"))
        @ThemeVarEditor("TableBackgroundAccent")
        @ThemeVarEditor("TableBackgroundHover")
        @ThemeVarEditor("TableBorder")
        @ThemeVarEditor("ContainerBackground", "Container")
        @ThemeVarEditor("ContainerBorder")
        @ThemeVarEditor("ContainerRadius")
        @ThemeVarEditor("ContainerBodyLinkColor")
        @ThemeVarEditor("ContainerHeaderBackground")
        @ThemeVarEditor("ContainerHeaderFontColor")
        @ThemeVarEditor("ContainerHeaderHeight")
        @ThemeVarEditor("ContainerBodyBackground")
        @ThemeVarEditor("ContainerBodyFontColor")

    </table>
}

@helper TabMisc()
{
    <table class="adminContent">
        @ThemeVarEditor("WellBackground")
        @ThemeVarEditor("ItemBoxBoxShadowColor")
        @ThemeVarEditor("SimpleBoxHeaderColor")
        @ThemeVarEditor("PaginationBackground", "Paginator")
        @ThemeVarEditor("PaginationBorder")
        @ThemeVarEditor("PaginationActiveBackground")

        @ThemeVarEditor("InputBackground", T("ThemeVar.Alpha.Forms"))
        @ThemeVarEditor("InputBorder")
        @ThemeVarEditor("InputBorderRadius")
        @ThemeVarEditor("InputDisabledBackground")
        @ThemeVarEditor("FormActionsBackground")

        @ThemeVarEditor("DropdownBackground", "Dropdowns")
        @ThemeVarEditor("DropdownBorder")
        @ThemeVarEditor("DropdownDividerTop")
        @ThemeVarEditor("DropdownDividerBottom")
        @ThemeVarEditor("DropdownLinkColor")
        @ThemeVarEditor("DropdownLinkColorHover")
        @ThemeVarEditor("DropdownLinkColorActive")
        @ThemeVarEditor("DropdownLinkBackgroundActive")
        @ThemeVarEditor("DropdownLinkBackgroundHover")

        @ThemeVarEditor("ProductFilterBackgroundColor", "Product Filter")
        @ThemeVarEditor("CheckoutProgressBackgroundColor", "Checkout Progress Bar")
        @ThemeVarEditor("AlternateListItemBackgroundColor", "Alternate List Item")

    </table>
}

@helper ThemeVarEditor(string varName, string groupName = null) 
{
    if (groupName != null) 
    {
        <tr>
            @if(groupName != "")
            {
                <td colspan="2" class="group-name">
                    <h4>@groupName</h4>
                    <hr/>
                </td>
            }
            else {
                <td colspan="2"><hr /></td>
            }
        </tr>
    }
    <tr>
        <td class="adminTitle">
            @Html.ThemeVarLabel(ThemeManifest.Variables[varName])
        </td>
        <td class="adminData">
            @Html.ThemeVarEditor(ThemeManifest.Variables[varName], Model[varName])
        </td>
    </tr>
}

